package thinking

object 函数基础 {
  def main(args: Array[String]): Unit = {
    val func = (n1: Int, n2: Int) => n1 + n2
    println(func(1, 2))

    //斐波那契

    def fib(n: Int): Int = {
      if (n == 1 || n == 2) {
        1
      } else {
        fib(n - 1) + fib(n - 2)
      }
    }

  }
}
